package com.caigou.service;

import com.caigou.bean.cms.entity.Audio;
import com.caigou.bean.cms.entity.AudioFolder;
import com.caigou.bean.cms.param.*;
import com.caigou.bean.exam.entity.Users;
import com.caigou.util.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface AudioService {
    /************************ AudioFolder interface *********************/
    AudioFolder getRootAudioFolder();

    Result createAudioFolder(Integer superId, String folderName, String userId);

    int saveAudioFolder(AudioFolder audioFolder);

    List<AudioFolder> listAudioFolderBySuperId(Integer superId);

    Result deleteAudioFolder(Integer id);

    /************************ Audio interface *********************/
    Result uploadAudio(MultipartFile[] files, String[] audioNotes, Integer folderId, String audioSource, String audioEditor, String userId);

    int saveAudio(Audio audio);

    PageInfo<Audio> queryAudioIncludingSubfolders(Integer folderId, String keyword, Integer pageNum, Integer pageSize);

    PageInfo<Audio> queryAudioIncludingSubfolders(AudioQueryParam audioQueryParam, Users user);

    Result updateAudio(AudioParam audioParam, Users user);

    Result updateAudioName(Integer id, String newAudioName, String userId);

    Result updateAudioNote(Integer id, String newAudioNote, String userId);

    Result updateAudioSource(Integer id, String newAudioSource, String userId);

    Result updateAudioEditor(Integer id, String newAudioEditor, String userId);

    Result deleteAudio2Recycle(Integer id);
    
    Result deleteAudio2Recycle(Integer[] ids);

//    Result updateAudioIsUse(Integer id, Integer newAudioIsUse, String userId);

    Result getAudioTotalSize();

    Result useAudio(AudioUseParam audioUseParam);

    Result updateAudioDefaultFolder(AudioFolderParam audioFolderParam);

    Result moveAudio(Integer[] ids, Integer targetFolderId);

    int moveAudio(Integer id, Integer targetFolderId);

    PageInfo<Audio> queryAudioInRecycle(AudioRecycleQueryParam audioRecycleQueryParam);

    Result restoreAudio(Integer[] ids);

    Result restoreAudio(Integer id);

    Result deleteAudioFromRecycle(Integer[] ids);

    Result deleteAudioFromRecycle(Integer id);

    Result clearRecycle();
}
